Add LibrarySort Implementation#7481
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7481 +/- ##
============================================
+ Coverage 80.24% 80.30% +0.05%
- Complexity 7357 7390 +33
============================================
Files 810 811 +1
Lines 23787 23882 +95
Branches 4678 4701 +23
============================================
+ Hits 19089 19178 +89
- Misses 3941 3944 +3
- Partials 757 760 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
27b0040 to
1427328
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new LibrarySort implementation under com.thealgorithms.sorts, along with a dedicated JUnit test class to validate basic behavior.
Changes:
- Introduces
LibrarySortsorting implementation and API (LibrarySort.sort(int[])). - Adds
LibrarySortTestwith basic correctness and input-validation tests (including null input).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/main/java/com/thealgorithms/sorts/LibrarySort.java |
Adds the new sorting implementation and its Javadoc/API. |
src/test/java/com/thealgorithms/sorts/LibrarySortTest.java |
Adds unit tests covering common input shapes and null handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1427328 to
0669834
Compare
0669834 to
f9ce5c0
Compare
|
Hi, just wanted to follow up on this PR — all the requested changes have been addressed and comments resolved. Could you take another look when you get a chance? Happy to make any further adjustments if needed. Thanks! |
|
Hi, pinging once more on this — all the flagged errors have been addressed and comments resolved. Let me know if there's anything else you'd like changed before merging. Thanks! |
DenizAltunkapan
left a comment
There was a problem hiding this comment.
Thanks for the contribution! The code is clean and well tested. A few changes are needed first:
- This is not really Library Sort. The Javadoc admits there are no gaps, so it is basically insertion sort with binary search (O(n^2)). Please implement the actual gapped version, or the algorithm does not add something new to the repo.
Integer[]boxing. UsingInteger[]withnullmarkers to find gaps is slow and memory-heavy. If you keep the gapped design, please track filled positions without boxing.- Move the author tag.
// author: ...on line 2 of the test file should not be there; author info belongs in the class Javadoc.
If you switch to a true gapped implementation, the current tests are a good base to keep.
372ca36 to
0af0297
Compare
0af0297 to
bb157c1
Compare
bb157c1 to
73d96f4
Compare
|
Thanks for the detailed feedback! I've pushed an update that addresses all three points:
Let me know if anything else stands out! |
clang-format -i --style=file path/to/your/file.java